luci-mod-status: handle ct helpers in nftables
authorPaul Donald <[email protected]>
Wed, 15 Oct 2025 13:23:19 +0000 (15:23 +0200)
committerPaul Donald <[email protected]>
Wed, 15 Oct 2025 13:23:22 +0000 (15:23 +0200)
These appear when modules such as the following are installed:
-kmod-nf-nathelper
-kmod-nf-nathelper-extra

They render as e.g.:

 Utilise *ftp* conntrack helper

when fw4 rules similar to the following exist

```
table inet fw4 {
        chain helper_lan {
                tcp dport 21 ct helper set "ftp" comment "!fw4: FTP passive connection tracking"
        }
}
```

ht @dave14305 for the working code diff

Signed-off-by: Paul Donald <[email protected]>
modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js

index 4feac4690ce4f5043112a02d0b5c09a4d7683add..4862c90e2ac5416ac8cf4867d628e01abd19cf25 100644 (file)
@@ -138,6 +138,7 @@ var action_translations = {
 
        'return': _('Continue in calling chain'),
 
+       'ct helper': _('Utilise <strong>%h</strong> conntrack helper'),
        'flow': _('Utilize flow table <strong>%h</strong>')
 };
 
@@ -168,6 +169,7 @@ return view.extend({
                                case 'masquerade':
                                case 'return':
                                case 'flow':
+                               case 'ct helper':
                                case 'log':
                                        return true;
                                }
@@ -407,6 +409,11 @@ return view.extend({
                case 'match':
                        return this.renderMatchExpr(spec);
 
+               case 'ct helper':
+                       return E('span', {
+                                       'class': 'ifacebadge'
+                       }, action_translations[kind].format(spec));
+
                case 'reject':
                        var k = 'reject.%s'.format(spec.type);